<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">红包名称：</label>
                            <div class="col-sm-8">
                                <input id="redName" name="redName" class="form-control" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">设置领取类型:</label>
                            <div class="col-sm-8">
	                            <label class="radio-inline"> <input type="radio" name="setType" value="0" checked="checked"/> 按上下限区间
	                            </label>
	                            <label class="radio-inline"> <input type="radio" name="setType" value="1" /> 按充值金额的百分比
	                            </label> 
                            </div>
                        </div>
                        <div id="setType1" class="form-group" style="display: none;">
                            <label class="col-sm-3 control-label">按充值金额的百分比：</label>
                            <div class="col-sm-8">
                                <input id="rate" name="rate" class="form-control"
                                       type="text" value="0.00">
                            </div>
                        </div>
                        <div id="setType0">
	                        <div class="form-group">
	                            <label class="col-sm-3 control-label">红包金额：</label>
	                            <div class="col-sm-8">
	                                <input id="amount" name="amount" class="form-control"
	                                       type="text" value="0.00">
	                            </div>
	                        </div>
	                        <div class="form-group">
	                            <label class="col-sm-3 control-label">下限：</label>
	                            <div class="col-sm-8">
	                                <input id="lowerLimit" name="lowerLimit" class="form-control"
	                                       type="text" value="0.00">
	                            </div>
	                        </div>
	                        <div class="form-group">
	                            <label class="col-sm-3 control-label">上限：</label>
	                            <div class="col-sm-8">
	                                <input id="upLimit" name="upLimit" class="form-control"
	                                       type="text" value="0.00">
	                            </div>
	                        </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">说明：</label>
                            <div class="col-sm-8">
                                <input id="description" name="description" class="form-control"
                                       type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">所属合伙人：</label>
                            <!--<input id="userId" name="userId" type="hidden" th:value="${red.redId}">-->
                            <div class="columns pull-left col-md-2">
                                <select data-placeholder="选择红包所属合伙人" class="form-control chosen-select"
                                        tabindex="2" style="width: 100%" name="userId">
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">状态:</label>
                            <div class="col-sm-8">
                                <label class="radio-inline"> <input type="radio"
                                                                    name="state" value="1" checked="checked"/> 正常
                                </label> <label class="radio-inline"> <input type="radio"
                                                                             name="state" value="0"/> 禁用
                            </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button type="submit" class="btn btn-primary">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

</div>
<div th:include="include::footer"></div>
<script type="text/javascript" src="/js/appjs/partner/red/add.js">
</script>
<script type="text/javascript">
$(function(){
	$('input[type=radio][name=setType]').change(function() {
        if (this.value == '0') {
            $('#setType0').show();
            $('#setType1').hide();
        }
        else if (this.value == '1') {
            $('#setType1').show();
            $('#setType0').hide();
        }
    });
 });
</script>
</body>
</html>
